import { createRouter, createWebHistory } from 'vue-router'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'index',
      component: () => import('@/layout/index.vue'),
      redirect: '/home',
      children: [
        {
          path: '/home',
          name: 'home',
          meta: {},
          component: () => import('@/views/home/index.vue')
        },
        {
          path: '/prod',
          name: 'prod',
          component: () => import('@/views/prod/index.vue')
        },
        {
          path: '/apiDocs',
          name: 'apiDocs',
          component: () => import('@/views/apiDocs/index.vue')
        },
        {
          path: '/plugin',
          name: 'plugin',
          component: () => import('@/views/plugin/index.vue')
        },
        {
          path: '/help',
          name: 'help',
          component: () => import('@/views/help/index.vue')
        },
        {
          path: '/about',
          name: 'about',
          component: () => import('@/views/about/index.vue')
        },
      ]
    },
    {
	    path: '/:pathMatch(.*)*',
	    component: () => import('@/views/404/index.vue')
	  }
  ]
})

export default router
